package com.zrrd.yt.item.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.sql.Time;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author HongyueYang
 */
@Configuration
public class ThreadPoolConfig {
    //注入一个线程池对象
    @Bean
    public ThreadPoolExecutor getThreadPoolExecutor() {
        return new ThreadPoolExecutor(50, 500, 30, TimeUnit.SECONDS
                , new ArrayBlockingQueue<>(10000));

    }
}
